package com.zhuzi.guicollect.jsl;

import com.zhuzi.guicollect.jsl.page.BasePage;
import com.zhuzi.guicollect.jsl.page.OnlyOnePage;
import com.zhuzi.guicollect.utils.HttpUtils;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: MI
 * @Date: 2021/10/24/21:08
 * @Description:
 */
public class GetPage {
    /**
     * 返回true表示问题已经被删除
     *
     * @param url
     * @param path
     * @param onePage
     * @param onlyPublish
     * @return
     */
    public static void get(String url, String path, boolean onePage, boolean onlyPublish) {
        if (onePage) {
            new OnlyOnePage().collect(url, path, onePage, onlyPublish);
        } else {
            new BasePage().collect(url, path, onePage, onlyPublish);
        }
    }

    public static boolean isDeled(String url) {
        return StringUtils.contains(HttpUtils.httpGet(url), "问题不存在或已被删除");
    }

}
